package com.fanrenqiji.entity;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by yanwt on 2017/3/14.
 */
@Getter
@Setter
@Entity
@Table(name = "tb_message_queue")
@org.hibernate.annotations.Table(appliesTo = "tb_message_queue",comment = "消息队列")
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate
@org.hibernate.annotations.Cache(region="message_queue", usage = CacheConcurrencyStrategy.READ_WRITE)
public class MessageQueueEntity extends DataEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name="type",columnDefinition = ("int(1) not null comment '类型 0:短信，1:微信'"))
    private int type;

    @Column(name = "message_content", columnDefinition = "text not null comment '消息内容'")
    private String messageContent;

    @Column(name="add_time",columnDefinition="datetime not null comment '新增时间'")
    private Timestamp addTime;

    @Column(name="send_time",columnDefinition="datetime not null comment '发送时间'")
    private Timestamp sendTime;

    @Column(name = "destination", columnDefinition = "varchar(40) default null comment '接收人'")
    private String destination;

    @Column(name="status",columnDefinition = ("int(1) not null comment '发送状态 -1:失败 0:未发，1:已发 '"))
    private int status;

    @Column(columnDefinition = ("varchar(200) default null comment '链接地址'"))
    private String url;

}
